function BXColorPicker(o){if(!o.name)o.name=o.id;if(!o.title)o.title=o.name;this.disabled=false;this.bCreated=false;this.bOpened=false;this.zIndex=o.zIndex?o.zIndex:1e3;this.fid=o.id.toLowerCase();this.oPar=o;this.oneGifSrc="/bitrix/images/1.gif";this.BeforeCreate()}BXColorPicker.prototype.BeforeCreate=function(){var o=this;this.pWnd=BX.create("IMG",{props:{src:this.oneGifSrc,title:this.oPar.title,className:"bx-colpic-button bx-colpic-button-normal",id:"bx_btn_"+this.oPar.id.toLowerCase()}});this.pWnd.onmouseover=function(e){o.OnMouseOver(e,this)};this.pWnd.onmouseout=function(e){o.OnMouseOut(e,this)};this.pWnd.onclick=function(e){o.OnClick(e,this)};this.pCont=BX.create("DIV",{props:{className:"bx-colpic-button-cont"}});this.pCont.appendChild(this.pWnd)};BXColorPicker.prototype.Create=function(){var o=this;window["bx_colpic_keypress_"+this.fid]=function(e){o.OnKeyPress(e)};window["bx_colpic_click_"+this.fid]=function(e){o.OnDocumentClick(e)};this.pColCont=document.body.appendChild(BX.create("DIV",{props:{className:"bx-colpic-cont"}}));BX.ZIndexManager.register(this.pColCont);var e=["#ACE9FB","#BEEDF1","#9AE1DD","#E3F19E","#FFED9A","#FFDD99","#DFD3B7","#E2C6BC","#FEAD99","#FFBDBC","#FFCBD8","#FEC5E4","#C5BBEC","#DBDDE0","#DBF199","#FFBEBD","#3AD0FF","#A6DC00","#FF5C5A","#B47153","#2FC7F7","#04B4AB","#FFA801","#5CD1DF","#6E54D1","#29AD49","#FE5957","#DAA187","#78D4F1","#43DAD2","#EECE8F","#AEE5EC","#FF0000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF","#FFFFFF","#EBEBEB","#E1E1E1","#D7D7D7","#CCCCCC","#C2C2C2","#B7B7B7","#ACACAC","#A0A0A0","#959595","#EE1D24","#FFF100","#00A650","#00AEEF","#2F3192","#ED008C","#898989","#7D7D7D","#707070","#626262","#555555","#464646","#363636","#262626","#111111","#000000","#F7977A","#FBAD82","#FDC68C","#FFF799","#C6DF9C","#A4D49D","#81CA9D","#7BCDC9","#6CCFF7","#7CA6D8","#8293CA","#8881BE","#A286BD","#BC8CBF","#F49BC1","#F5999D","#F16C4D","#F68E54","#FBAF5A","#FFF467","#ACD372","#7DC473","#39B778","#16BCB4","#00BFF3","#438CCB","#5573B7","#5E5CA7","#855FA8","#A763A9","#EF6EA8","#F16D7E","#EE1D24","#F16522","#F7941D","#FFF100","#8FC63D","#37B44A","#00A650","#00A99E","#00AEEF","#0072BC","#0054A5","#2F3192","#652C91","#91278F","#ED008C","#EE105A","#9D0A0F","#A1410D","#A36209","#ABA000","#588528","#197B30","#007236","#00736A","#0076A4","#004A80","#003370","#1D1363","#450E61","#62055F","#9E005C","#9D0039","#790000","#7B3000","#7C4900","#827A00","#3E6617","#045F20","#005824","#005951","#005B7E","#003562","#002056","#0C004B","#30004A","#4B0048","#7A0045","#7A0026"];var t,i,n,s=BX.create("TABLE",{props:{className:"bx-colpic-tbl"}}),c,l=e.length;t=s.insertRow(-1);i=t.insertCell(-1);i.colSpan=8;var r=i.appendChild(BX.create("SPAN",{props:{className:"bx-colpic-def-but"}}));r.innerHTML=window.jsColorPickerMess.DefaultColor;r.onmouseover=function(){this.className="bx-colpic-def-but bx-colpic-def-but-over";n.style.backgroundColor="transparent"};r.onmouseout=function(){this.className="bx-colpic-def-but"};r.onclick=function(e){o.Select(false)};n=t.insertCell(-1);n.colSpan=8;n.className="bx-color-inp-cell";n.style.backgroundColor=e[38];for(c=0;c<l;c++){if(Math.round(c/16)==c/16)t=s.insertRow(-1);i=t.insertCell(-1);i.innerHTML="&nbsp;";i.className="bx-colpic-col-cell";i.style.backgroundColor=e[c];i.id="bx_color_id__"+c;i.onmouseover=function(o){this.className="bx-colpic-col-cell bx-colpic-col-cell-over";n.style.backgroundColor=e[this.id.substring("bx_color_id__".length)]};i.onmouseout=function(o){this.className="bx-colpic-col-cell"};i.onclick=function(t){var i=this.id.substring("bx_color_id__".length);o.Select(e[i])}}this.pColCont.appendChild(s);this.bCreated=true};BXColorPicker.prototype.OnClick=function(o,e){if(this.disabled)return false;if(!this.bCreated)this.Create();if(this.bOpened)return this.Close();this.Open()};BXColorPicker.prototype.Open=function(){var o=BX.align(this.pWnd,240,130),e=this;BX.bind(window,"keypress",window["bx_colpic_keypress_"+this.fid]);BX.defer(function(){BX.bind(window,"click",window["bx_colpic_click_"+e.fid])})();this.pColCont.style.display="block";this.pColCont.style.top=o.top+"px";this.pColCont.style.left=o.left+"px";BX.ZIndexManager.bringToFront(this.pColCont);this.bOpened=true};BXColorPicker.prototype.Close=function(){this.pColCont.style.display="none";BX.unbind(window,"keypress",window["bx_colpic_keypress_"+this.fid]);BX.unbind(window,"click",window["bx_colpic_click_"+this.fid]);this.bOpened=false};BXColorPicker.prototype.OnMouseOver=function(o,e){if(this.disabled)return;e.className="bx-colpic-button bx-colpic-button-over"};BXColorPicker.prototype.OnMouseOut=function(o,e){if(this.disabled)return;e.className="bx-colpic-button bx-colpic-button-normal"};BXColorPicker.prototype.OnKeyPress=function(o){if(!o)o=window.event;if(o.keyCode==27)this.Close()};BXColorPicker.prototype.OnDocumentClick=function(o){if(!o)o=window.event;var e=o.target||o.srcElement;if(e&&!BX.findParent(e,{className:"bx-colpic-cont"}))this.Close()};BXColorPicker.prototype.Select=function(o){if(this.oPar.OnSelect&&typeof this.oPar.OnSelect=="function")this.oPar.OnSelect(o,this);this.Close()};
//# sourceMappingURL=script.map.js